from hmPy import *from hmPy import *の記述
ほとんどのマクロの文、マクロのキーワード、マクロの関数を、だいたいそのままで表記できるようになっています。(一部例外はあります) hmPyにはjsmodeと同じ使用感の関数のほとんどが実装されていますこの機能を利用する場合、秀丸エディタ v8.98 (正式版 or β9以上)を強く推奨します。 from hmPy import *
jsmodeとは異なるものDll読み込み関連DLL読み込み関連は、「loadDllなど、jsmode独特のDllマネージ機能」は実装されていません。 COM読み込み関連COM読み込み関連は、「createObjectなど、jsmode独特のcreateObject」は実装されていません。
のみが用意されています。 非同期関連jsmodeの非同期関連、例えば、postExecMacroFileやpostExecMacroMemoryは実装されていません。 currentjsfilenameexecjsで動作するわけではないため、currentjsfilenameは機能しません。 getresultex, geteventparam, getconfig, memberは、返す型を示唆する書き方getresultex.rstr(...)、geteventparam.rstr(...)、getconfig.rnum(...)、method.rnum(...)、method.rstr(...)など、 getlinecountとenumregvalueこれらは、jsmodeとは異なり、2つの値を返します。 from hmPy import * nLine, nColumn = getlinecount("ABCD\nXYZ",7, 0); # 最後の引数は不要なので、ダミーの0を入れておく hm.OutputPane.Output([nLine, nColumn]) from hmPy import * openreg("CURRENTUSER", "Software\\Hidemaruo\\Hidemaru"); i = 0; while( 1 ): strVal, nRegType = enumregvalue( i, 0 ); # 最後の受け取り用の引数は不要なので、ダミーの0を入れておく if strVal=="": break; hm.OutputPane.Output(str(strVal) + "\t" + str(nRegType) + "\r\n"); i = i + 1; closereg(); 一般的な文/キーワード/関数
後述の書き方が変わるものやサポートしていないもの以外は、文/キーワード/関数をそのままの名前で、パラメータ全体に()を付けるだけでメソッドとして使用可能です。 ()を付けずに関数名だけで書いてしまう場合、エラーにならないので注意が必要です。 衝突を避ける書き方import hmPy as hg 書き方が変わるものopenfileやsearchdown等の予約語パラメータは、数値openfile等の予約語パラメータはencode相当の数値になります。 getconfig、getconfigcolorでできるキーワードgetconfigでできるキーワードの多くはサポートせず、getconfigで取得します。 パラメータで受け取る関数getlinecount、enumregvalueは返り値の他にパラメータで結果を受け取る特殊な使い方ですが、オブジェクトを渡して結果を受け取ります。 pythonとの関数名衝突の都合上、関数名等が変更、もしくは不要だったものfind文はfind1()、replace文はreplace1()、escape文はescapeselect()に名前を変更しています。 サポートしないもの以下のものは()を付けるだけの書き換えする方法はサポートしません。 execmacro js execjs jsmode call refcall setactivehidemaru nexthidemaru prevhidemaru nexthidemaruicon prevhidemaruicon nexttab prevtab GREP FIND ENV exit系、quit系 COM関係 (getobject callmethod callmethod_returnstr callmethod_returnnum callmethod_returnobj getpropstr getpropnum getpropobj setpropstr setpropnum setpropobj getcollection allowobjparam setcomdetachmethod) getconfigでできるキーワード (fontcharset boldstate width kinsokustate correctlineno linespace freecursor tabcount indentstate showtab showruler tabruler linenostate pagestate formwidth hilightstate hilighttitle savewitheof ignoreeof backup) getconfigcolorでできるキーワード (tcolor bcolor lcolor ccolor rcolor rulercolor rulerbackcolor) encodeuri decodeuri split join DDE関係全部 return(キーワード) true(キーワード) false(キーワード) yes no eof |